﻿namespace DAL.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class AddAttachment : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.attachment",
                c => new
                    {
                        AttachmentId = c.Guid(nullable: false),
                        FileName = c.String(maxLength: 500),
                        Extension = c.String(maxLength: 50),
                        MediaType = c.String(maxLength: 50),
                        FileStream = c.Binary(),
                        Option = c.String(maxLength: 100),
                        BusinessId = c.String(maxLength: 100),
                    })
                .PrimaryKey(t => t.AttachmentId)
                .Index(t => t.BusinessId);
            
        }
        
        public override void Down()
        {
            DropIndex("dbo.attachment", new[] { "BusinessId" });
            DropTable("dbo.attachment");
        }
    }
}
